package com.hntest.service;

import com.hntest.entity.Moneywithdraw;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.math.BigDecimal;

import static org.junit.Assert.*;
@RunWith(SpringRunner.class)
@SpringBootTest
public class MoneyWithDrawServiceTest {

        @Autowired
        private MoneyWithDrawService moneyWithDrawService;
        @Test
        public void drawMoney() {
        Moneywithdraw draw = new Moneywithdraw();
        draw.setAccountNumber("6236682010010925450");
        draw.setCharge(BigDecimal.valueOf(0.2));
        draw.setMoneyAmount(BigDecimal.valueOf(200));
        int n = moneyWithDrawService.DrawMoney(draw);
        System.out.println("成功了？："+n);
    }
}